<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>XXX后台管理</title>
    <script src="js/jquery-3.2.1.js"></script>
    <script src="layui/layui.js"></script>
    <script src="layui/lay/modules/layer.js"></script>
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="layui/css/modules/layer/default/layer.css">
</head>
<body>
<fieldset class="layui-elem-field">
    <legend>订单详情</legend>
    <div class="layui-field-box">
        <fieldset class="layui-elem-field layui-field-title">
            <legend style="font-size: 15px;">联系人信息</legend>
            <div class="layui-field-box" style="padding: 0;">
                <table class="layui-table" lay-skin="row">
                    <colgroup>
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>联系人</th>
                        <th>手机号码</th>
                        <th>地址</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <#if orderInfo?exists &&(orderInfo?size > 0)> 
                        <td><#if orderInfo[0].user_name?exists>${orderInfo[0].user_name}</#if></td>
                        <td><#if orderInfo[0].user_tel?exists>${orderInfo[0].user_tel}</#if></td>
                        <td><#if orderInfo[0].user_sheng?exists>${orderInfo[0].user_sheng} — ${orderInfo[0].user_shi} — ${orderInfo[0].user_qu}</#if></td>
                        </#if>
                    </tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field layui-field-title">
            <legend style="font-size: 15px;">订单内容</legend>
            <div class="layui-field-box">
                <table class="layui-table" lay-skin="row">
                    <colgroup>
                        <col>
                        <col>
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>节目名称</th>
                        <th>演出时长</th>
                        <th>价格</th>
                        <th style="text-align: center">合计</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#if orderInfo?exists &&(orderInfo?size > 0)> 
                    <#list orderInfo as item>  
                    <tr>
                        <td>${item.pd_title}</td>
                        <td>${item.publish_time}</td>
                        <td>${item.publish_price}元</td>
                        <#if item_index==0>
                        <td style="text-align: center;color: red;" rowspan="2">${orderInfo[0].order_total_price}元</td>
                    </#if>
                    </tr>
                    </#list> 
                </#if>
                </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field layui-field-title">
            <legend style="font-size: 15px;">订单进度</legend>
            <div class="layui-field-box">
                <table class="layui-table" lay-skin="row" style="text-align: center">
                    <colgroup>
                        <col width="150">
                        <col width="200">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th style="text-align: center">订单状态</th>
                        <th style="text-align: center">下单时间</th>
                        <th style="text-align: center">支付时间</th>
                        <th style="text-align: center">演出时间</th>
                        <th style="text-align: center">处理时间</th>
                        <th style="text-align: center">完成时间</th>
                        <th style="text-align: center">退款时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <#if orderInfo?exists &&(orderInfo?size > 0)> 
                        <td><#if orderInfo[0].status?exists>${orderInfo[0].status}</#if></td>
                        <td><#if orderInfo[0].d?exists>${orderInfo[0].d} ${orderInfo[0].t}</#if></td>
                        <td><#if orderInfo[0].pd?exists>${orderInfo[0].pd} ${orderInfo[0].pt}</#if></td>
                        <td><#if orderInfo[0].sd?exists>${orderInfo[0].sd} ${orderInfo[0].st}</#if></td>
                        <td><#if orderInfo[0].rd?exists>${orderInfo[0].rd} ${orderInfo[0].rt}</#if></td>
                        <td><#if orderInfo[0].wd?exists>${orderInfo[0].wd} ${orderInfo[0].wt}</#if></td>
                        <td><#if orderInfo[0].tkd?exists>${orderInfo[0].tkd} ${orderInfo[0].tkd}</#if></td>
                    </#if>
                    </tr>
                    </tbody>
                </table>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field layui-field-title">
            <legend style="font-size: 15px;">演员安排</legend>
            <div class="layui-field-box">
                <table id="yanyuananpai" class="layui-table" lay-skin="center" style="text-align: center">
                    <colgroup>
                        <col>
                        <col>
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th style="text-align: center">节目名称</th>
                        <th style="text-align: center">演出时长</th>
                        <th style="text-align: center">价格</th>
                        <th style="text-align: center">演员</th>
                        <th style="text-align: center">取消/分配</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#if orderInfo?exists &&(orderInfo?size > 0)> 
                    <#list orderInfo as item>  
                    <tr>
                        <td>${item.pd_title}</td>
                        <td>${item.publish_time}</td>
                        <td>${item.publish_price}元</td>
                        <td><#if actorList?exists>
                            <#list actorList as actor>  
                            <#if actor.feeScale_id==item.feeScale_id && actor.pd_id==item.pd_id>
                            【${actor.actor_name}：${actor.actor_tel}】
                        </#if>
                    </#list> 
                    </#if></td>
                    <td>
                        <#if orderInfo[0].order_status==1 || orderInfo[0].order_status==2 >
                        <a style="color: #2D93CA" class="layui-table-link"
                           href="/manager/getActorListByPublish_id_page?publish_id=${item.pd_id}&order_feeScale_id=${item.order_feeScale_id}&order_id=${orderInfo[0].order_id}">安排</a>
                        <#else>
                        <a style="color: darkgrey" class="layui-table-link" href="javascript:;">安排</a>
                    </#if>
                    </td>
                    </tr>
                </#list> 
            </#if>
            </tbody>
            </table>
    </div>
</fieldset>
</div>
<div style="width: 100%; margin: 0;text-align: center">
    <#if orderInfo[0].order_status==1><a
        href="/manager/updateOrderStatus?order_id=${orderInfo[0].order_id}&order_status=<#if orderInfo[0].order_status==1>2</#if><#if orderInfo[0].order_status==2>3</#if>"
        style="width: 30%" class="layui-btn"><#if orderInfo[0].order_status==1>处理完毕</#if></a><#if orderInfo[0].order_status==2>出演完毕
</#if></a></#if>
<#if orderInfo[0].order_status==2><a
        href="/manager/updateOrderStatus?order_id=${orderInfo[0].order_id}&order_status=<#if orderInfo[0].order_status==2>3</#if>"
        style="width: 30%" class="layui-btn"><#if orderInfo[0].order_status==2>出演完毕</#if></a></#if>
</div>
<#if orderInfo[0].order_status==3>
<fieldset class="layui-elem-field layui-field-title">
    <legend style="font-size: 15px;">订单评价</legend>
    <div class="layui-field-box">
        <table class="layui-table" lay-skin="center" style="text-align: center">
            <colgroup>
                <col col width="150">
                <col>
            </colgroup>
            <!--<thead>-->
            <!--<tr>-->
            <!--<th>评价标签</th>-->
            <!--<th>评价内容</th>-->
            <!--</tr>-->
            <!--</thead>-->
            <tbody>
            <tr>
                <td>评价标签</td>
                <td>
                    <#if orderInfo[0].order_grade==1>不满意
                </#if>
                <#if orderInfo[0].order_grade==2>一般
            </#if>
            <#if orderInfo[0].order_grade==3>满意
            </#if>
            <#if orderInfo[0].order_grade==4>非常满意
        </#if>
        </td>
        </tr>
        <tr>
            <td>评价内容</td>
            <td>${orderInfo[0].order_sales}</td>
        </tr>
        </tbody>
        </table>
    </div>
</fieldset>
</#if>
</fieldset>
<script>
    function cancel(feeScale_id) {
        $.ajax({
            url: "cancelActor_idByFeeScale_id",
            data: {'feeScale_id': feeScale_id},
            success: function (res) {
                if (res.code == 0) {
                    location.reload();
                }
            }
        });
    }

    function deletePublishByOrder_feeScale_id(order_feeScale_id) {
        alert(order_feeScale_id);
        layer.confirm('纳尼？', {
            btn: ['确定', '取消'] //可以无限个按钮
            , btn3: function (index, layero) {
                //按钮【按钮三】的回调
            }
        }, function (index, layero) {
            alert("将要提交");
            $.ajax({
                type: "post",
                url: "deletePublishByOder_feeScale_id",
                data: {"order_feeScale_id": order_feeScale_id},
                success: function (res) {
                    if (res.code == 0) {
                        layer.close(index);
                        layer.msg("删除成功！", {icon: 1});
                        location.reload();
                    } else {
                        layer.msg("发生错误！", {icon: 5})
                    }
                }
            });
            layer.close(index);
        }, function (index) {
        });
    }
</script>
</body>
</html>